﻿<%@ Page Language="C#" MasterPageFile="~/User/NhanVien.master" AutoEventWireup="true"
    Theme="Default" CodeFile="XuatHang.aspx.cs" Inherits="User_XuatHang" Title="Lập phiếu xuất hàng" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        .style1
        {
            text-align: right;
        }
    </style>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div id="content_t">
        &nbsp;</div>
    <div id="content" class="style1">
        <div align="center" id="formkh">
            <h3>
                Thông Tin Khách Hàng
            </h3>
            <table>
                <tbody>
                    <tr>
                        <td>
                            <asp:Table SkinID="Table" runat="server">
                                <asp:TableHeaderRow SkinID="TableHeaderRow">
                                    <asp:TableHeaderCell ColumnSpan="3">Khách hàng thân thiết</asp:TableHeaderCell>
                                </asp:TableHeaderRow>
                                <asp:TableRow>
                                    <asp:TableCell SkinID="TableCell">Mã khách hàng
                                    </asp:TableCell>
                                    <asp:TableCell SkinID="TableCell">
                                        <asp:TextBox CssClass="TextBox" ID="txtMaKH" runat="server" Width="141px"></asp:TextBox>
                                    </asp:TableCell>
                                    <asp:TableCell SkinID="TableCell">
                                        <asp:Button ID="txtNhapMaKH" runat="server" Text="Xác nhận" OnClick="txtNhapMaKH_Click" CausesValidation="False" />
                                    </asp:TableCell>
                                </asp:TableRow>
                                <asp:TableFooterRow SkinID="TableFooterRow">
                                    <asp:TableHeaderCell ColumnSpan="3">
                                        <asp:Image ID="Image1" runat="server" Visible="False" />
                                        <asp:Label ID="Label1" runat="server" Text="Label" Visible="False"></asp:Label>
                                    </asp:TableHeaderCell>
                                </asp:TableFooterRow>
                            </asp:Table>
                        </td>
                        <td>
                            <asp:Table SkinID="Table" runat="server">
                                <asp:TableRow>
                                    <asp:TableCell SkinID="TableCell">
                                        Tên khách hàng:
                                    </asp:TableCell>
                                    <asp:TableCell SkinID="TableCell">
                                        <asp:TextBox CssClass="TextBox" ID="txtTenKH" runat="server" Width="250px"></asp:TextBox>
                                    </asp:TableCell>
                                    <asp:TableCell SkinID="TableCell">
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*" ControlToValidate="txtTenKH"></asp:RequiredFieldValidator>
                                    </asp:TableCell>
                                </asp:TableRow>
                                <asp:TableRow>
                                    <asp:TableCell SkinID="TableCell">
                                        Địa chỉ:
                                    </asp:TableCell>
                                    <asp:TableCell SkinID="TableCell">
                                        <asp:TextBox CssClass="TextBox" ID="txtDiaChiKH" runat="server" Width="250px"></asp:TextBox>
                                    </asp:TableCell>
                                    <asp:TableCell SkinID="TableCell">
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="*" ControlToValidate="txtDiaChiKH"></asp:RequiredFieldValidator>
                                    </asp:TableCell>
                                </asp:TableRow>
                                <asp:TableRow>
                                    <asp:TableCell SkinID="TableCell">
                                        Số điện thoại:
                                    </asp:TableCell>
                                    <asp:TableCell SkinID="TableCell">
                                        <asp:TextBox CssClass="TextBox" ID="txtSdtKH" runat="server" Width="250px"></asp:TextBox>
                                    </asp:TableCell>
                                    <asp:TableCell SkinID="TableCell">
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="*" ControlToValidate="txtSdtKH"></asp:RequiredFieldValidator>
                                    </asp:TableCell>
                                </asp:TableRow>
                                <asp:TableRow>
                                    <asp:TableCell SkinID="TableCell">
                                        Giảm giá:
                                    </asp:TableCell>
                                    <asp:TableCell SkinID="TableCell">
                                        <asp:TextBox CssClass="TextBox" ID="txtGiamGia" runat="server" Width="250px" Text="0"></asp:TextBox>
                                    </asp:TableCell>
                                    <asp:TableCell SkinID="TableCell">
                                        VNĐ
                                    </asp:TableCell>
                                </asp:TableRow>
                            </asp:Table>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div id="form" align="center">
            <h3>
                Thông Tin Sản Phẩm</h3>
            <asp:Table SkinID="Table" runat="server">
                <asp:TableHeaderRow SkinID="TableHeaderRow">
                    <asp:TableHeaderCell>
                        Tên sản phẩm
                    </asp:TableHeaderCell>
                    <asp:TableHeaderCell>
                        Số lượng
                    </asp:TableHeaderCell>
                    <asp:TableHeaderCell>
                        Đơn giá
                    </asp:TableHeaderCell>
                </asp:TableHeaderRow>
                <asp:TableRow>
                    <asp:TableCell SkinID="TableCell">
                        <asp:DropDownList CssClass="TextBox" ID="cmbTenSP" runat="server" Width="200px">
                        </asp:DropDownList>
                    </asp:TableCell>
                    <asp:TableCell SkinID="TableCell">
                        <asp:TextBox CssClass="TextBox" ID="txtSoLuong" runat="server" Width="100px"></asp:TextBox>
                    </asp:TableCell>
                    <asp:TableCell SkinID="TableCell">
                        <asp:TextBox CssClass="TextBox" ID="txtDonGia" runat="server" Width="116px"></asp:TextBox>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableFooterRow SkinID="TableFooterRow">
                    <asp:TableHeaderCell ColumnSpan="3">
                        <asp:Button ID="btnThemSP" runat="server" Text="Thêm sản phẩm" OnClick="btnThemSP_Click" CausesValidation="False" />
                    </asp:TableHeaderCell>
                </asp:TableFooterRow>
            </asp:Table>
            <div id="list">
            <asp:GridView SkinID="GridView" ID="gvSanPham" runat="server" AutoGenerateColumns="False"
                OnRowCommand="gvSanPham_RowCommand" OnRowDeleting="gvSanPham_RowDeleting" 
                    AllowPaging="True">
                <Columns>
                    <asp:BoundField DataField="masp" HeaderText="Mã sản phẩm" />
                    <asp:BoundField DataField="tensp" HeaderText="Tên sản phẩm" />
                    <asp:TemplateField HeaderText="Số lượng">
                        <ItemTemplate>
                            <asp:TextBox CssClass="TextBox" ID="gv_soluong" runat="server" Text='<%# Eval("soluong") %>'></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Đơn giá">
                        <ItemTemplate>
                            <asp:TextBox CssClass="TextBox" ID="gv_dongia" runat="server" Text='<%# Eval("dongia") %>'></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="thanhtien" HeaderText="Thành tiền" />
                    <asp:ButtonField CommandName="CapNhat" Text="Cập nhật" />
                    <asp:CommandField ShowDeleteButton="True" DeleteText="Xóa" />
                </Columns>
            </asp:GridView>
            </div>
            <div class="AlignRight">
                Tổng tiền:
            <asp:Label ID="lbTongTien" runat="server" Text="0"></asp:Label>
            <br />
            <asp:Button ID="btnXuatHang" runat="server" OnClick="btnXuatHang_Click" Text="Lưu phiếu xuất hàng" />
            </div>
        </div>
    </div>
    <div id="content_b">
        &nbsp;</div>
</asp:Content>
